#ifndef __UNIT_H__
#define __UNIT_H__
#include <sstream>


enum UNIT_TYPE {
   LENGTH = 0,
   VOLUME ,
};

class Unit
{
 public:
    Unit(int unit,UNIT_TYPE type);     
    int amountToBaseValue(const int amount) const;
    int getAmount(const int baseVlaue) const;
    int getUnit() const;
    UNIT_TYPE getType() const;

 private:    
    int unit;
    UNIT_TYPE	type;
};

class UnitCalc
{
 public:
    UnitCalc(const int amount, const Unit& unit);
    bool isSameType(const UnitCalc& unitCalc) const;
    int getBaseValue(const UnitCalc& unitCalc) const;
    int toBaseValue(const UnitCalc& unitCalc) const;
    bool operator==(const UnitCalc& unitCalc) const;
    bool operator!=(const UnitCalc& unitCalc) const;  
    UnitCalc operator+(const UnitCalc& unitCalc) const; 
    std::string printInUnitFormat() const;
    std::string printInMinUnitFormat() const;
 private:
    int amount;
    const Unit& unit;
};
#endif
